home *** CD-ROM | disk | FTP | other *** search
/ MaxiMac 1999 December / MaxiMac 97.iso / KitWeb / Club-Internet / Logiciels d'installation / Scripts de modem / Supra 56 (Force 336) / Supra 56 (Force 336)
Encoding:
Text File  |  1998-08-20  |  12.6 KB  |  686 lines  |  [mlts/slnk]

  1. !  Supra 56k V.90
  2. !    Author:    Kris Kreutzman
  3. !
  4. !    Copyright:    © 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  5. !
  6. !    revision history:
  7. !        v2.1    as shipped with the ARA 2.1
  8. !
  9. !  'mlts' resource info for this modem:
  10. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  11. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  12. !    byte 3 == 40 -> max number of chars in varstr 7
  13. !    byte 4 == 40 -> max number of chars in varstr 8
  14. !    byte 5 == 40 -> max number of chars in varstr 9
  15. !    
  16. !    
  17. !    Changes Copyright:    © 1998 Diamond Multimedia    All Rights Reserved. 
  18. !
  19. !    revision history:
  20. !        v2.1D    to accomodate 56k connections:  TLJ
  21. !
  22. !        Modified init string to lock speed at 33600 or slower
  23. !        Added result codes 32000 - 54000 (Label 110-120)
  24. !        Omitted code 48000 (already included as Label 55)
  25. !        Relabeled Label 59 as: Connection Established
  26. !        Changed Label 98 to initialize with &F1
  27. !        Corrected spelling in Label 3 & 27 "Response"
  28. !        Removed addition of Calling Tone (\^) at Label 15,19, 24,27
  29. !        Added result codes for V.90 compatibility (Label 73-79, 83-89)
  30. !        Added "L" to init string for volume adjustment
  31. !
  32. @ORIGINATE
  33. @ANSWER
  34. !
  35. ! ---- Initial modem setup ----
  36. !
  37. ! Set serial port speed depending upon the compression flag
  38. !    A higher rate with compression on to handle expanded data from the modem
  39. !    A lower rate closer to the DCE when compression is off
  40. ifstr 5 1 "0"
  41. serreset 57600, 0, 8, 1
  42. jump 2
  43. !
  44. @LABEL 1
  45. serreset 38400, 0, 8, 1
  46. !
  47. @LABEL 2
  48. hsreset 0 0 0 0 0 0
  49. settries 0
  50. !
  51. ! Get the modem's attention
  52. !
  53. matchclr
  54. matchstr 1 3 "OK\13\10"
  55. write "AT\13"
  56. matchread 30
  57. !
  58. @LABEL 3
  59. !
  60. ! Setup the modem for the following:
  61. !   Reset to factory settings
  62. !   Standard compression/reliablity
  63. !   Lock serial port speed
  64. !   Serial port hardware handshaking, turn off software handshaking
  65. !   Verbose responses and compression/protocol results
  66. !   CONNECT returns DCE speed
  67. !   Turn off answering
  68. !   Reset or return to command mode on DTR toggle (optional)
  69. !
  70. matchclr
  71. matchstr 1 4   "OK\13\10"
  72. matchstr 2 101 "ERROR\13\10"
  73. write "AT&F1L&C1&D2W2E0S7=150+MS=11\13"
  74. matchread 30
  75. inctries
  76. iftries 3 101
  77. !
  78. ! Reset the Modem on setup failure
  79. !
  80. DTRClear
  81. pause 5
  82. DTRSet
  83. flush
  84. jump 3
  85. !
  86. !
  87. @LABEL 4
  88. ! Varstring 4 , reliable link protocol:
  89. !    = 0, handled by computer (ARAP)
  90. !    = 1, handled by modem (PPP)
  91. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  92. ifstr 4 5 "1"
  93. ifstr 4 5 "2"
  94. !
  95. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  96. matchclr
  97. matchstr 1 9 "OK\13\10"
  98. write "AT\\N0\13"
  99. matchread 30
  100. jump 101
  101. !
  102. !
  103. @LABEL 5
  104. ! Varstring 5, compression protocol:
  105. !    = 0, handled by computer 
  106. !    = 1, handled by modem
  107. ifstr 5 9 "1"
  108. !
  109. ! Varstring 5 == 0, turn off compression protocol in modem.
  110. matchclr
  111. matchstr 1 9 "OK\13\10"
  112. write "AT%C0\13"
  113. matchread 30
  114. jump 101
  115. !
  116. !
  117. @LABEL 9
  118. ! Varstring 2, modem speaker:
  119. !    = 0, speaker off
  120. !    = 1, speaker on
  121. ifstr 2 13 "1"
  122. pause 5
  123. matchclr
  124. matchstr 1 13 "OK\13\10"
  125. write "ATM0\13"
  126. matchread 30
  127. jump 101
  128. !
  129. ! Modem ready, wait for a call or originate a call
  130. !
  131. @LABEL 13
  132. ifANSWER 32
  133. !
  134. !
  135. ! ---- Originating a call ----
  136. !
  137. ! Varstring 6, dialing mode:
  138. !    = 0, normal dialing
  139. !    = 1, blind dialing
  140. !    = 2, manual dialing
  141. ifstr 6 17 "1"
  142. ifstr 6 15 "2"
  143. jump 19
  144. !
  145. @LABEL 15
  146. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  147. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 107
  148. note "Manual dialing initiated" 3
  149. ! X1 to ignore dialtone & busy, D to dial, \^ for data tone
  150. !    (\^ removed with v2.1D)
  151. write "ATX1D\13"
  152. jump 32
  153. !
  154. @LABEL 17
  155. note "Dialing without tone" 3
  156. matchclr
  157. matchstr 1 19 "OK\13\10"
  158. ! X1 to ignore dialtone & busy
  159. write "ATX1\13"
  160. matchread 30
  161. jump 101
  162. !
  163. !
  164. @LABEL 19
  165. ! Display the full dialstring contained in Varstring 1
  166. note "Dialing ^1" 3
  167. !
  168. ! Varstrings 7, 8 and 9, contain dialstring fragments
  169. !    Long phone numbers may need to be split into smaller groups
  170. !    for the modem to use
  171. !
  172. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  173. ! Varstring 8 == blank (dialstring in varstring 7)
  174. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  175. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  176. ! \^ is added to the dialstring to force the modem to generate a data tone
  177. !    (removed with v2.1D)
  178. ifstr 8 27 " "
  179. ifstr 9 24 " "
  180. !
  181. !  Write dialstring in varstrings 7, 8 & 9
  182. matchclr
  183. matchstr 1 21 "OK\13\10"
  184. write "ATD^3^7;\13"
  185. matchread 400
  186. jump 101
  187.  
  188. @LABEL 21
  189. matchclr
  190. matchstr 1 22 "OK\13\10"
  191. write "ATD^3^8;\13"
  192. matchread 400
  193. jump 101
  194.  
  195. @LABEL 22
  196. write "ATD^3^9\13"
  197. jump 32
  198. !
  199. !
  200. @LABEL 24
  201. !  Write dialstring in varstrings 7 & 8
  202. matchclr
  203. matchstr 1 25 "OK\13\10"
  204. write "ATD^3^7;\13"
  205. matchread 400
  206. jump 101
  207. !(\^ removed with v2.1D)
  208.  
  209. @LABEL 25
  210. write "ATD^3^8\13"
  211. jump 32
  212. !
  213. @LABEL 27
  214. !  Write dialstring in varstring 7
  215. write "ATD^3^7\13"
  216. !(\^ removed with v2.1D)
  217. !
  218. !
  219. !    ---- Connection response ----
  220. !
  221. ! The following section will parse modem responses of two types:
  222. !   1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
  223. !   2) CONNECT xxx/ARQ/V42
  224. !
  225. @LABEL 32
  226. matchclr
  227. matchstr  1 81  "RING\13\10"
  228. matchstr  2 102 "NO DIALTONE\13\10"
  229. matchstr  3 103 "NO CARRIER"
  230. matchstr  4 103 "ERROR\13\10"
  231. matchstr  5 104 "BUSY\13\10"
  232. matchstr  6 105 "NO ANSWER\13\10"
  233. matchstr  7 33  "CONNECT "
  234. matchstr  8 32  "CARRIER"
  235. matchstr  9 40  "CONNECT\13\10"
  236. matchstr 10 62  "PROTOCOL: LAP"
  237. matchstr 11 62  "PROTOCOL: MNP"
  238. matchstr 12 62  "PROTOCOL: ALT"
  239. matchstr 13 67  "COMPRESSION: V"
  240. matchstr 14 67  "COMPRESSION: MNP5"
  241. matchstr 15 67  "COMPRESSION: CLASS"
  242. matchread 700
  243. ifANSWER 32
  244. jump 101
  245. !
  246. !  Parse the speed of connect result codes
  247. !  2400 and 4800 have two entries each
  248. !  to distinguish them from 24000 and 48000
  249. !
  250. @LABEL 33
  251. matchclr
  252. matchstr  1 40 "2400\13"
  253. matchstr  2 40 "2400/"
  254. matchstr  3 41 "4800\13"
  255. matchstr  4 41 "4800/"
  256. matchstr  5 42 "7200"
  257. matchstr  6 43 "9600"
  258. matchstr  7 44 "12000"
  259. matchstr  8 45 "14400"
  260. matchstr  9 46 "16800"
  261. matchstr 10 47 "19200"
  262. matchstr 11 48 "21600"
  263. matchstr 12 49 "24000"
  264. matchstr 13 50 "26400"
  265. matchstr 14 51 "28800"
  266. matchstr 15 52 "31200"
  267. matchstr 16 53 "33600"
  268. matchstr 17 54 "38400"
  269. matchstr 18 55 "48000"
  270. matchstr 19 56 "56000"
  271. matchstr 20 57 "57600"
  272. matchstr 21 58 "64000"
  273. matchstr 22 110 "32000"
  274. matchstr 23 111 "34000"
  275. matchstr 24 112 "36000"
  276. matchstr 25 113 "38000"
  277. matchstr 26 114 "40000"
  278. matchstr 27 115 "42000"
  279. matchstr 28 116 "44000"
  280. matchstr 29 117 "46000"
  281. matchstr 30 118 "50000"
  282. matchstr 31 119 "52000"
  283. matchstr 32 120 "54000"
  284. matchstr 33 73 "2933"
  285. matchstr 34 74 "3066"
  286. matchstr 35 75 "3333"
  287. matchstr 36 76 "3466"
  288. matchstr 37 77 "3733"
  289. matchstr 38 78 "3866"
  290. matchstr 39 79 "4133"
  291. matchstr 40 83 "4266"
  292. matchstr 41 84 "4533"
  293. matchstr 42 85 "4666"
  294. matchstr 43 86 "4933"
  295. matchstr 44 87 "5066"
  296. matchstr 45 88 "5333"
  297. matchstr 46 89 "5466"
  298. matchread 30
  299. jump 59
  300. !
  301. ! -- Connection rates --
  302. ! CommunicatingAt informs ARA of the raw modem to modem
  303. ! connection speed.
  304. !
  305. @LABEL 40
  306. note "Communicating at 2400 bps." 2
  307. CommunicatingAt 2400
  308. jump 60
  309. !
  310. @LABEL 41
  311. note "Communicating at 4800 bps." 2
  312. CommunicatingAt 4800
  313. jump 60
  314. !
  315. @LABEL 42
  316. note "Communicating at 7200 bps." 2
  317. CommunicatingAt 7200
  318. jump 60
  319. !
  320. @LABEL 43
  321. note "Communicating at 9600 bps." 2
  322. CommunicatingAt 9600
  323. jump 60
  324. !
  325. @LABEL 44
  326. note "Communicating at 12400 bps." 2
  327. CommunicatingAt 12400
  328. jump 60
  329. !
  330. @LABEL 45
  331. note "Communicating at 14400 bps." 2
  332. CommunicatingAt 14400
  333. jump 60
  334. !
  335. @LABEL 46
  336. note "Communicating at 16800 bps." 2
  337. CommunicatingAt 16800
  338. jump 60
  339. !
  340. @LABEL 47
  341. note "Communicating at 19200 bps." 2
  342. CommunicatingAt 19200
  343. jump 60
  344. !
  345. @LABEL 48
  346. note "Communicating at 21600 bps." 2
  347. CommunicatingAt 21600
  348. jump 60
  349. !
  350. @LABEL 49
  351. note "Communicating at 24000 bps." 2
  352. CommunicatingAt 24000
  353. jump 60
  354. !
  355. @LABEL 50
  356. note "Communicating at 26400 bps." 2
  357. CommunicatingAt 26400
  358. jump 60
  359. !
  360. @LABEL 51
  361. note "Communicating at 28800 bps." 2
  362. CommunicatingAt 28800
  363. jump 60
  364. !
  365. @LABEL 52
  366. note "Communicating at 31200 bps." 2
  367. CommunicatingAt 31200
  368. jump 60
  369. !
  370. @LABEL 53
  371. note "Communicating at 33600 bps." 2
  372. CommunicatingAt 33600
  373. jump 60
  374. !
  375. @LABEL 54
  376. note "Communicating at 38400 bps." 2
  377. CommunicatingAt 38400
  378. jump 60
  379. !
  380. @LABEL 55
  381. note "Communicating at 48000 bps." 2
  382. CommunicatingAt 48000
  383. jump 60
  384. !
  385. @LABEL 56
  386. note "Communicating at 56000 bps." 2
  387. CommunicatingAt 56000
  388. jump 60
  389. !
  390. @LABEL 57
  391. note "Communicating at 57600 bps." 2
  392. CommunicatingAt 57600
  393. jump 60
  394. !
  395. @LABEL 58
  396. note "Communicating at 64000 bps." 2
  397. CommunicatingAt 64000
  398. jump 60
  399. !
  400. @LABEL 110
  401. note "Communicating at 32000 bps." 2
  402. CommunicatingAt 32000
  403. jump 60
  404. @LABEL 111
  405. note "Communicating at 34000 bps." 2
  406. CommunicatingAt 34000
  407. jump 60
  408. @LABEL 112
  409. note "Communicating at 36000 bps." 2
  410. CommunicatingAt 36000
  411. jump 60
  412. @LABEL 113
  413. note "Communicating at 38000 bps." 2
  414. CommunicatingAt 38000
  415. jump 60
  416. @LABEL 114
  417. note "Communicating at 40000 bps." 2
  418. CommunicatingAt 40000
  419. jump 60
  420. @LABEL 115
  421. note "Communicating at 42000 bps." 2
  422. CommunicatingAt 42000
  423. jump 60
  424. @LABEL 116
  425. note "Communicating at 44000 bps." 2
  426. CommunicatingAt 44000
  427. jump 60
  428. @LABEL 117
  429. note "Communicating at 46000 bps." 2
  430. CommunicatingAt 46000
  431. jump 60
  432. !
  433. @LABEL 118
  434. note "Communicating at 50000 bps." 2
  435. CommunicatingAt 50000
  436. jump 60
  437. @LABEL 119
  438. note "Communicating at 52000 bps." 2
  439. CommunicatingAt 52000
  440. jump 60
  441. @LABEL 120
  442. note "Communicating at 54000 bps." 2
  443. CommunicatingAt 54000
  444. jump 60
  445. @LABEL 73
  446. note "Communicating at 29333 bps." 2
  447. CommunicatingAt 29333
  448. jump 60
  449. @LABEL 74
  450. note "Communicating at 30666 bps." 2
  451. CommunicatingAt 30666
  452. jump 60
  453. @LABEL 75
  454. note "Communicating at 33333 bps." 2
  455. CommunicatingAt 33333
  456. jump 60
  457. @LABEL 76
  458. note "Communicating at 34666 bps." 2
  459. CommunicatingAt 34666
  460. jump 60
  461. @LABEL 77
  462. note "Communicating at 37333 bps." 2
  463. CommunicatingAt 37333
  464. jump 60
  465. @LABEL 78
  466. note "Communicating at 38666 bps." 2
  467. CommunicatingAt 38666
  468. jump 60
  469. @LABEL 79
  470. note "Communicating at 41333 bps." 2
  471. CommunicatingAt 41333
  472. jump 60
  473. @LABEL 83
  474. note "Communicating at 42666 bps." 2
  475. CommunicatingAt 42666
  476. jump 60
  477. @LABEL 84
  478. note "Communicating at 45333 bps." 2
  479. CommunicatingAt 45333
  480. jump 60
  481. @LABEL 85
  482. note "Communicating at 46666 bps." 2
  483. CommunicatingAt 46666
  484. jump 60
  485. @LABEL 86
  486. note "Communicating at 49333 bps." 2
  487. CommunicatingAt 49333
  488. jump 60
  489. @LABEL 87
  490. note "Communicating at 50666 bps." 2
  491. CommunicatingAt 50666
  492. jump 60
  493. @LABEL 88
  494. note "Communicating at 53333 bps." 2
  495. CommunicatingAt 53333
  496. jump 60
  497. @LABEL 89
  498. note "Communicating at 54666 bps." 2
  499. CommunicatingAt 54666
  500. jump 60
  501. !
  502. @LABEL 59
  503. note "Connection Established." 2
  504. jump 60
  505. !
  506. ! Look for reliablilty and compression results 
  507. ! at the end of the connect result.
  508. !
  509. @LABEL 60
  510. matchclr
  511. matchstr  1 63 "LAPM"
  512. matchstr  2 63 "REL"
  513. matchstr  3 63 "ARQ"
  514. matchstr  4 68 "COMP/"
  515. matchstr  5 68 "COMP\13"
  516. matchstr  6 63 "V42/"
  517. matchstr  7 63 "V42\13"
  518. matchstr  8 68 "V42BIS"
  519. matchstr  9 68 "V42bis"
  520. matchstr 10 63 "MNP\13"
  521. matchstr 11 68 "MNP5"
  522. matchstr 12 70 "\10"
  523. matchread 30
  524. jump 70
  525.  
  526. ! -- Modem error correction link negotiation --
  527. ! Userhook 2 informs ARA that a modem-to-modem error
  528. ! correcting protocol has been negotiated
  529. !
  530. !
  531. @LABEL 62
  532. note "Modem Reliable Link Established." 2
  533. userhook 2
  534. jump 32
  535. !
  536. @LABEL 63
  537. note "Modem Reliable Link Established." 2
  538. userhook 2
  539. jump 60
  540. !
  541. ! -- Compression negotiation --
  542. ! Userhook 3 informs ARA that a modem-to-modem compression
  543. ! protocol has been negotiated
  544. !
  545. @LABEL 67
  546. note "Modem Compression Established." 2
  547. userhook 3
  548. jump 32
  549. !
  550. @LABEL 68
  551. note "Modem Compression Established." 2
  552. userhook 3
  553. jump 60
  554. !
  555. !
  556. ! -- Normal exit after "CONNECT" --
  557. !
  558. !  This modem has been setup to do CTS handshaking,
  559. !  and we assume that a CTS handshaking cable is being used.
  560. !
  561. @LABEL 70
  562. ! Turn on CTS handshaking.
  563. HSReset 0 1 0 0 0 0
  564. !
  565. ifANSWER 71
  566. pause 30
  567. @LABEL 71
  568. exit 0
  569. !
  570. !
  571. ! ---- Answer calls ----
  572. !
  573. !    A RING result from the modem and in ANSWERING mode
  574. !    claims the serial port and answering the phone
  575. !
  576. @LABEL 81
  577. ifORIGINATE 32
  578. userhook 1
  579. note "Answering phone..." 2
  580. write "ATA\13"
  581. jump 32
  582. !
  583. !
  584. ! ---- Hang up and reset modem ----
  585. !
  586. @HANGUP
  587. @LABEL 90
  588. settries 0
  589. HSReset 0 0 0 0 0 0
  590. !
  591. @LABEL 92
  592. !  Escape from data to command mode
  593. matchclr
  594. matchstr 1 96 "OK\13\10"
  595. write "+++"
  596. matchread 20
  597. !
  598. @LABEL 94
  599. ! Force a hangup
  600. matchclr
  601. matchstr 1 98 "NO CARRIER\13\10"
  602. matchstr 2 98 "OK\13\10"
  603. matchstr 3 98 "ERROR\13\10"
  604. matchstr 4 98 "0\13\10"
  605. write "ATH\13"
  606. matchread 30
  607. ! Try to get control of the modem by toggling DTR
  608. DTRClear
  609. pause 5
  610. DTRSet
  611. flush
  612. !
  613. ! Try the hangup sequence three times otherwise declare and error
  614. inctries
  615. iftries 3 101
  616. jump 92
  617. !
  618. @LABEL 96
  619. ! Pause between data and command mode
  620. pause 50
  621. jump 94
  622. !
  623. !
  624. @LABEL 98
  625. ! Recall the factory settings
  626. pause 15
  627. matchclr
  628. matchstr 1 99 "OK\13\10"
  629. write "AT&F1\13"
  630. matchread 30
  631. jump 101
  632. !
  633. @LABEL 99
  634. exit 0
  635. !
  636. ! ---- Error messages -----
  637. !
  638. ! Modem Not Responding
  639. @LABEL 101
  640. exit -6019
  641. !
  642. ! No Dial Tone
  643. @LABEL 102
  644. exit -6020
  645. !
  646. ! No Carrier or Error
  647. @LABEL 103
  648. exit -6021
  649. !
  650. ! Busy
  651. @LABEL 104
  652. exit -6022
  653. !
  654. ! No Answer
  655. @LABEL 105
  656. exit -6023
  657. !
  658. ! User Cancellation
  659. @LABEL 107
  660. exit -6008
  661.